package com.qijian.flowable.mapper;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.flowable.domain.Flow;
import com.qijian.flowable.domain.FlowDetail;
import com.qijian.flowable.domain.query.FlowQuery;
import com.qijian.flowable.domain.vo.FlowCheck;
import com.qijian.flowable.domain.vo.FlowDetailVo;
import com.qijian.flowable.domain.vo.FlowVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 流程Mapper接口
 *
 * @author qijian
 * @date 2024-03-01
 */
public interface FlowMapper extends BaseMapper<Flow> {

    @Select("select count(0) from main_flow WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    List<FlowDetail> countFlowByConditon(@Param("flowType") String flowType, @Param("ids") List<Long> ids);

    FlowVo getInfoById(Long id);


    List<FlowCheck> checkKnife(@Param("flowType") String flowType, @Param("ids") List<Long> ids, @Param("flowId") Long flowId);

    List<FlowCheck> checkKnifeYhp(@Param("flowType") String flowType, @Param("ids") List<Long> ids, @Param("flowId") Long flowId);


    Page<FlowVo> selectVo(Page<FlowVo> page, @Param(Constants.WRAPPER) Wrapper<FlowQuery> queryWrapper);

    Page<FlowDetailVo> selectVoNew(Page<FlowVo> page, @Param(Constants.WRAPPER) Wrapper<FlowQuery> queryWrapper);


}
